package fileupload

import (
	"fmt"
	"ginjt/amazons3utils"
	"github.com/gin-gonic/gin"
)

//xxx?filename=yyy.zzz
func DownFileInUrl(c *gin.Context) {
	filename := c.DefaultQuery("filename","")
	amazons3utils.DownloadFile("gotest1",filename,c.Writer,amazons3utils.GetSession())
}


func DownFileRest(c *gin.Context) {
	// 多文件
	filename := c.Param("filename")
	year := c.Param("year")
	//filename := c.Query("filename")
	fmt.Println(filename)

	amazons3utils.DownloadFile("gotest1",year+"/"+filename,c.Writer,amazons3utils.GetSession())


}